<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
	<title>SST GLOVE - China Gloves Manufacturer. Heat Resistant Gloves. Cut Resistant Gloves</title>
	<meta charset="UTF-8" />
	<meta http-equiv="X-UA-compatible" content="IE=edge"/>
	<meta name="viewport" content="width=device-width, initial-scale=1"/>
	<link rel="shortcut icon" type="image/x-icon" href="assets/images/favicon.png"/>
	<link rel="stylesheet" href="assets/css/bootstrap.min.css" />
	<link rel="stylesheet" href="assets/css/font-awesome.min.css"/>
	<link rel="stylesheet" href="assets/css/owl.carousel.min.css"/>
	<link rel="stylesheet" href="assets/css/animate.min.css"/>
	<link rel="stylesheet" href="assets/css/jquery-ui.css"/>
	<link rel="stylesheet" href="assets/css/slick.css"/>
	<link rel="stylesheet" href="assets/css/chosen.min.css"/>
	<link rel="stylesheet" href="assets/css/pe-icon-7-stroke.css"/>
	<link rel="stylesheet" href="assets/css/magnific-popup.min.css"/>
	<link rel="stylesheet" href="assets/css/lightbox.min.css"/>
	<link rel="stylesheet" href="assets/js/fancybox/source/jquery.fancybox.css"/>
	<link rel="stylesheet" href="assets/css/jquery.scrollbar.min.css"/>
	<link rel="stylesheet" href="assets/css/mobile-menu.css"/>
	<link rel="stylesheet" href="assets/fonts/flaticon/flaticon.css"/>
	<link rel="stylesheet" href="assets/css/style.css"/>
</head>
<body class="inblog-page">
	<header th:replace="head :: html"></header>
	<div class="main-content main-content-blog list left-sidebar">
		<div class="container">
			<div class="row">
				<div class="col-lg-12">
					<div class="breadcrumb-trail breadcrumbs">
						<ul class="trail-items breadcrumb">
							<li class="trail-item trail-begin">
								<a href="index.html">SST Glove</a>
							</li>
							<li class="trail-item trail-end active">
								Blog list
							</li>
						</ul>
					</div>
				</div>
			</div>
			<div class="row">
				<div class="content-area content-blog col-lg-9 col-md-8 col-sm-12 col-xs-12">
					<div class="site-main">
						<div class="row">
							<h3 class="custom_blog_title">
								Blog List
								<button class="submit button" style="float:right;">POST A BLOG</button>
							</h3>

						</div>
						<div class="blog-list list-style">
							<div class="blog-item">
								<div class="post-info">
									<!--<div class="category-blog">
										<a href="#">ACCESSORIES</a>
									</div>-->
									<h3 class="post-title">
										<a href="#">防切割手套简介</a>
									</h3>
									<div class="main-info-post">
										<p class="des">
											防切割手套是一种金属手套。钢丝手套，由无数小圆环穿编而成。它的作用是在使用切割机械的作业过程中，保护手不被割伤。[...]
										</p>
									</div>
									<div class="author-view">
										<div class="author">
											<div class="avt">
												<img src="assets/images/avt-blog1.png" alt="img"/>
											</div>
											<h3 class="name">
												苏仕达管理员
											</h3>
										</div>
										<div class="review" style="   display: inline-block;">
											<div class="view">
												<span class="icon-view">
													<i class="fa fa-eye" ></i>
												</span>
												<span class="count">
													631
												</span>
											</div>
											<div class="s-comments">
												<span class="icon-cmt">
													<i class="fa fa-commenting"></i>
												</span>
												<span class="count">
													82
												</span>
											</div>
										</div>
									</div>
								</div>
							</div>

						</div>
						<div class="pagination clearfix style2">
							<div class="nav-link">
								<a href="#" class="page-numbers"><i class="icon fa fa-angle-left" aria-hidden="true"></i></a>
								<a href="#" class="page-numbers">1</a>
								<a href="#" class="page-numbers">2</a>
								<a href="#" class="page-numbers current">3</a>
								<a href="#" class="page-numbers"><i class="icon fa fa-angle-right" aria-hidden="true"></i></a>
							</div>
						</div>
					</div>
				</div>
				<div class="sidebar sidebar-blog col-lg-3 col-md-4 col-sm-12 col-xs-12">
					<div class="wrapper-sidebar">
						<div class="widget widget-tags">
							<h3 class="widgettitle">
								Hot Subject
							</h3>
							<ul class="tagcloud">
								<li class="tag-cloud-link">
									<a href="#">Cut Resistant Gloves</a>
								</li>
								<li class="tag-cloud-link">
									<a href="#">Heat Resistant Gloves</a>
								</li>
								<li class="tag-cloud-link">
									<a href="#">Sport Gloves</a>
								</li>
								<li class="tag-cloud-link active">
									<a href="#">手套等级</a>
								</li>
								<li class="tag-cloud-link">
									<a href="#">Glove material</a>
								</li>
								<li class="tag-cloud-link">
									<a href="#">材料知识</a>
								</li>
								<li class="tag-cloud-link">
									<a href="#">Glove machine</a>
								</li>
								<li class="tag-cloud-link">
									<a href="#">手套浸胶</a>
								</li>
							</ul>
						</div>
						<div class="widget widget-post">
							<h3 class="widgettitle">Hot content</h3>
							<ul class="herald-posts">
								<li class="widget-post-item">
									<div class="thumb-blog">
										<img src="assets/images/sidebar-post1.jpg" alt="img"/>
									</div>
									<div class="post-content">
										<div class="cat">
											<a href="#">苏仕达管理员</a>
										</div>
										<h5 class="post-title"><a href="#">防切割手套简介 <span>[...]</span></a></h5>
									</div>
								</li>
								<li class="widget-post-item">
									<div class="thumb-blog">
										<img src="assets/images/sidebar-post2.jpg" alt="img"/>
									</div>
									<div class="post-content">
										<div class="cat">
											<a href="#">苏仕达管理员</a>
										</div>
										<h5 class="post-title"><a href="#">高强聚乙烯防切割手套织物工艺与性能的研究 <span>[...]</span></a></h5>
									</div>
								</li>

							</ul>
						</div>

						<div class="widget newsletter-widget">
							<div class="newsletter-form-wrap ">
								<h3 class="title">Subscribe Our News</h3>
								<div class="subtitle">
									Subscribe our new product, news and knowledge.
								</div>
								<input type="email" class="email" placeholder="Input your email or phone number" />
								<button type="submit" class="button submit-newsletter">Subscribe</button>
							</div>
						</div>


						<div th:if=" ${session.user} == 'admin'">
							<a data-toggle="modal" data-target="#myModal"> 添加 </a>
						</div>

					</div>
				</div>
			</div>
		</div>
	</div>
	<div th:replace="foot :: html"></div>


	<!-- 模态框（Modal） -->
	<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
		<div class="modal-dialog">
			<form id="editBlog-form">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×
						</button>
						<h4 class="modal-title" id="myModalLabel">
							新增文章
						</h4>
					</div>
					<div class="modal-body">


						<table>
							<tr>
								标题：<input style="width: 100%" type="text" id="edit_Title" name="title" value="" />
							</tr>

							<tr>
								标签：<input style="width: 100%" type="text" name="tags" id="edit_Tags" value="" />
							</tr>

							<tr>内容：<textarea id="edit_Content" name="content" rows="8" cols="30" value="" /></tr>
						</table>

					</div>
					<div class="modal-footer">
						<button type="button" class="btn btn-default" data-dismiss="modal">
							关闭
						</button>
						<button type="button" onclick="saveBlog()" class="btn btn-primary">
							保存
						</button>
					</div>
				</div><!-- /.modal-content -->
			</form>
		</div><!-- /.modal-dialog -->
	</div><!-- /.modal -->


	<a href="#" class="backtotop">
		<i class="fa fa-chevron-up"></i>
	</a>
	<script src="assets/js/jquery-1.12.4.min.js"></script>
	<script src="assets/js/jquery.plugin-countdown.min.js"></script>
	<script src="assets/js/jquery-countdown.min.js"></script>
	<script src="assets/js/bootstrap.min.js"></script>
	<script src="assets/js/owl.carousel.min.js"></script>
	<script src="assets/js/magnific-popup.min.js"></script>
	<script src="assets/js/isotope.min.js"></script>
	<script src="assets/js/jquery.scrollbar.min.js"></script>
	<script src="assets/js/jquery-ui.min.js"></script>
	<script src="assets/js/mobile-menu.js"></script>
	<script src="assets/js/chosen.min.js"></script>
	<script src="assets/js/slick.js"></script>
	<script src="assets/js/jquery.elevateZoom.min.js"></script>
	<script src="assets/js/jquery.actual.min.js"></script>
	<script src="assets/js/fancybox/source/jquery.fancybox.js"></script>
	<script src="assets/js/lightbox.min.js"></script>
	<script src="assets/js/owl.thumbs.min.js"></script>
	<script src="assets/js/jquery.scrollbar.min.js"></script>
	<script src="assets/js/frontend-plugin.js"></script>

	<script th:inline="javascript">

		function saveBlog() {


			$.ajax({
				//几个参数需要注意一下
				type: "POST",//方法类型
				dataType: "json",//预期服务器返回的数据类型
				url: "/api/blog/saveBlog.do" ,//url
				data: $('#editBlog-form').serialize(),
				success: function (message) {
					var result = message;
					alert(result.resultMessage);
					if (result.result) {
						// 刷新页面
						window.location.reload();
					}

				},
				error : function() {
					alert("保存异常！");
				}
			});
			// 必须返回false，否则表单会自己再做一次提交操作，并且页面跳转
			return false;
		}

	</script>
</body>
</html>